package com.sx.gongzhong.adapter.viewholder;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ImageView;

import com.bigkoo.convenientbanner.holder.Holder;
import com.bumptech.glide.Glide;
import com.sx.gongzhong.R;
import com.sx.gongzhong.model.BannerBean;
import com.sx.gongzhong.net.ServiceFactory;

/**
 * Created by Zhuyugui on 2017/7/17.
 *
 * 首页banner 的holder
 */
public class BannerHolderView implements Holder<BannerBean> {

    private ImageView imageView;

    @Override
    public View createView(Context context) {
        View view = LayoutInflater.from(context).inflate(R.layout.item_home_banner_cview, null);
        imageView= (ImageView) view.findViewById(R.id.imageView);
        return view;
    }

    @Override
    public void UpdateUI(Context context, int position, BannerBean data) {
        Glide.with(context).load(ServiceFactory.getUrl( data.photo.getPath())).into(imageView);
//        BaseUtil.loadImage(context,data,imageView);
    }
}
